<?php
	$newName=$_POST['newName'];
	
	$newDetail=$_POST['newDetail'];
	
	$newID=$_POST['newID'];
	$state=$_POST['state'];
	
	$newContent=$_POST['newContent'];
	
	$target="../user/upload/news/";
	
	$link = $target.$_FILES['newImage']['name'];
	
	move_uploaded_file($_FILES['newImage']['tmp_name'],$link);
	
	$query="INSERT INTO newdetails(newName,newDetail,newImage,newContent,datecreated,newID,state) VALUES ('$newName','$newDetail','$link','$newContent','','$newID','$state')";
	mysql_query($query);
	echo "Thêm tin tức thành công.";
	echo "<script>window.location='index.php?admin=newAdmin&do=listnew'</script>";
?>	